﻿package net.yogadigital.popit.utils 
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import net.yogadigital.popit.events.PopitEvent;
	
	/**
	 * ...
	 * @author Juanda
	 */
	public class CloseButton extends Sprite
	{
		public function CloseButton() 
		{
			this.buttonMode = true;
			this.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
		}
		
		/**
		 * Implements the Click behavior
		 * @param	e
		 */
		private function onClick(e:MouseEvent):void 
		{
			dispatchEvent(new PopitEvent(PopitEvent.CLOSE_BUTTON_PRESSED, true, true));
		}
	}
}